/* Gantt Chart 基础样式 */
.gantt-chart-container {
  position: relative;
  width: 100%;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  overflow: hidden;
  user-select: none;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  background-color: #fff;
}

.gantt-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background-color: #fafafa;
  border-bottom: 1px solid #e8e8e8;
}

.gantt-chart-title {
  font-size: 16px;
  font-weight: 500;
  color: #333;
}

.gantt-chart-controls {
  display: flex;
  gap: 8px;
}

.gantt-chart-body {
  display: flex;
  height: calc(100% - 45px);
}

.gantt-chart-sidebar {
  width: 200px;
  border-right: 1px solid #e8e8e8;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: #fafafa;
}

.gantt-chart-sidebar-header {
  height: 40px;
  line-height: 40px;
  padding: 0 10px;
  font-weight: 500;
  border-bottom: 1px solid #e8e8e8;
  background-color: #f5f5f5;
}

.gantt-chart-main {
  flex: 1;
  overflow: auto;
  position: relative;
}

.gantt-chart-timeline {
  height: 40px;
  border-bottom: 1px solid #e8e8e8;
  background-color: #f5f5f5;
  position: sticky;
  top: 0;
  z-index: 5;
}

.gantt-chart-content {
  position: relative;
}

.gantt-chart-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.gantt-chart-tasks {
  position: relative;
  z-index: 2;
}

.gantt-chart-dependencies {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

/* 任务样式 */
.gantt-task {
  position: absolute;
  height: 24px;
  border-radius: 4px;
  background-color: rgba(24, 144, 255, 0.1);
  border: 1px solid rgba(24, 144, 255, 0.5);
  box-sizing: border-box;
  cursor: move;
  z-index: 5;
  transition: box-shadow 0.2s;
}

.gantt-task:hover {
  box-shadow: 0 0 6px rgba(24, 144, 255, 0.5);
}

.gantt-task-content {
  display: flex;
  align-items: center;
  padding: 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 100%;
}

.gantt-task-progress {
  position: absolute;
  height: 100%;
  background-color: rgba(24, 144, 255, 0.3);
  border-radius: 3px 0 0 3px;
  z-index: -1;
}

.gantt-task-label {
  font-size: 12px;
  color: #333;
}

.gantt-task-milestone {
  position: absolute;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 20px solid #722ed1;
  cursor: pointer;
  z-index: 5;
}

.gantt-task-milestone-label {
  position: absolute;
  white-space: nowrap;
  font-size: 12px;
  top: 20px;
  left: -5px;
  color: #333;
}

.gantt-task-project {
  background-color: rgba(245, 34, 45, 0.1);
  border: 1px solid rgba(245, 34, 45, 0.5);
  border-radius: 0;
  font-weight: 500;
}

.gantt-task.selected {
  outline: 2px solid #1890ff;
  z-index: 10;
}

/* 依赖线样式 */
.gantt-dependency-line {
  stroke: #8c8c8c;
  stroke-width: 2;
  fill: none;
}

.gantt-dependency-arrow {
  fill: #8c8c8c;
}

/* 工具提示 */
.gantt-tooltip {
  position: absolute;
  z-index: 100;
  background-color: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  padding: 8px 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  max-width: 300px;
  font-size: 12px;
  pointer-events: none;
}

.gantt-tooltip-arrow {
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px;
  border-color: transparent transparent #fff transparent;
  top: -12px;
  left: 10px;
}

.gantt-tooltip-arrow::before {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px;
  border-color: transparent transparent #e8e8e8 transparent;
  top: -1px;
  left: -7px;
}

.gantt-tooltip-title {
  font-weight: 500;
  margin-bottom: 4px;
  color: #333;
}

.gantt-tooltip-dates {
  color: #666;
  margin-bottom: 4px;
}

.gantt-tooltip-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gantt-tooltip-progress-bar {
  flex: 1;
  height: 4px;
  background-color: #f0f0f0;
  border-radius: 2px;
}

.gantt-tooltip-progress-inner {
  height: 100%;
  background-color: #1890ff;
  border-radius: 2px;
}

.gantt-tooltip-progress-text {
  color: #666;
}

/* 控制柄 */
.gantt-task-handle {
  position: absolute;
  width: 6px;
  height: 24px;
  background-color: transparent;
  cursor: ew-resize;
  z-index: 6;
}

.gantt-task-handle-left {
  left: 0;
}

.gantt-task-handle-right {
  right: 0;
}

/* 时间线样式 */
.gantt-timeline-cell {
  position: absolute;
  height: 100%;
  border-right: 1px solid #e8e8e8;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  color: #666;
}

.gantt-timeline-cell.weekend {
  background-color: rgba(0, 0, 0, 0.02);
}

.gantt-timeline-cell.today {
  background-color: rgba(24, 144, 255, 0.05);
}

.gantt-timeline-cell-top {
  height: 20px;
  line-height: 20px;
  font-weight: 500;
}

.gantt-timeline-cell-bottom {
  height: 20px;
  line-height: 20px;
}

/* 网格线 */
.gantt-grid-row {
  position: absolute;
  width: 100%;
  border-bottom: 1px solid #f0f0f0;
  box-sizing: border-box;
}

.gantt-grid-col {
  position: absolute;
  height: 100%;
  border-right: 1px solid #f0f0f0;
  box-sizing: border-box;
}

.gantt-grid-today {
  position: absolute;
  width: 2px;
  height: 100%;
  background-color: #1890ff;
  z-index: 4;
}

/* 加载状态 */
.gantt-chart-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.gantt-chart-loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(24, 144, 255, 0.2);
  border-top-color: #1890ff;
  border-radius: 50%;
  animation: gantt-spinner 0.8s linear infinite;
}

@keyframes gantt-spinner {
  to {
    transform: rotate(360deg);
  }
}

/* 响应式布局 */
@media (max-width: 768px) {
  .gantt-chart-sidebar {
    width: 150px;
  }
}

@media (max-width: 576px) {
  .gantt-chart-sidebar {
    width: 120px;
  }
  
  .gantt-task-label {
    font-size: 10px;
  }
}